package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.IWorkerCertificationAuditService;
import com.jzo2o.customer.service.IWorkerCertificationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author: liZhiJun
 * @CreateTime: 2025-09-26
 * @Description: 服务端提交认证
 * @Version: 1.0
 */

@RestController("workerCertificationAuditController")
@RequestMapping("/worker")
public class CertificationAuditController {

    @Resource
    private IWorkerCertificationService workerCertificationService;

    @Resource
    private IWorkerCertificationAuditService workerCertificationAuditService;

    /**
     * 添加认证信息
     *
     * @param workerCertificationAuditAddReqDTO 服务人员认证信息
     */
    @PostMapping("/worker-certification-audit")
    public void workerCertificationAudit(@RequestBody WorkerCertificationAuditAddReqDTO workerCertificationAuditAddReqDTO) {
        workerCertificationService.addCertification(workerCertificationAuditAddReqDTO);
    }


    @GetMapping("/worker-certification-audit/rejectReason")
    @ApiOperation("获取最新拒绝原因")
    public RejectReasonResDTO getRejectReason() {
        return workerCertificationAuditService.getRejectReason();
    }
}
